<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * Invoice filter form base class.
 *
 * @package    wifilez
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseInvoiceFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'account_id'                 => new sfWidgetFormPropelChoice(array('model' => 'Account', 'add_empty' => true)),
      'applied_payment_total'      => new sfWidgetFormFilterInput(),
      'balance_due'                => new sfWidgetFormFilterInput(),
      'created'                    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'modified'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'discount'                   => new sfWidgetFormFilterInput(),
      'shipping_price'             => new sfWidgetFormFilterInput(),
      'shipping_date'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'shipping_method'            => new sfWidgetFormFilterInput(),
      'subtotal'                   => new sfWidgetFormFilterInput(),
      'tax'                        => new sfWidgetFormFilterInput(),
      'total'                      => new sfWidgetFormFilterInput(),
      'total_weight'               => new sfWidgetFormFilterInput(),
      'ip_addr'                    => new sfWidgetFormFilterInput(),
      'contacted_about_incomplete' => new sfWidgetFormFilterInput(),
      'is_printable'               => new sfWidgetFormFilterInput(),
      'google_order'               => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'account_id'                 => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Account', 'column' => 'account_id')),
      'applied_payment_total'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'balance_due'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'created'                    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'modified'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'discount'                   => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'shipping_price'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'shipping_date'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'shipping_method'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subtotal'                   => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'tax'                        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total'                      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_weight'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ip_addr'                    => new sfValidatorPass(array('required' => false)),
      'contacted_about_incomplete' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_printable'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'google_order'               => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('invoice_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Invoice';
  }

  public function getFields()
  {
    return array(
      'invoice_id'                 => 'Number',
      'account_id'                 => 'ForeignKey',
      'applied_payment_total'      => 'Number',
      'balance_due'                => 'Number',
      'created'                    => 'Date',
      'modified'                   => 'Date',
      'discount'                   => 'Number',
      'shipping_price'             => 'Number',
      'shipping_date'              => 'Date',
      'shipping_method'            => 'Number',
      'subtotal'                   => 'Number',
      'tax'                        => 'Number',
      'total'                      => 'Number',
      'total_weight'               => 'Number',
      'ip_addr'                    => 'Text',
      'contacted_about_incomplete' => 'Number',
      'is_printable'               => 'Number',
      'google_order'               => 'Text',
    );
  }
}
